package com.groupbuying.customerconsumer.service.impl;

import com.groupbuying.customerconsumer.domain.CustomerWxinfoRelDO;
import com.groupbuying.customerconsumer.service.CustomerWxinInfoService;
import com.groupbuying.customerconsumer.service.CustomerWxinfoRelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author gxy
 * @Description 会员微信账户信息相关业务
 * @Date 2019/5/14 10:10
 **/

@Service
public class CustomerWxinInfoServiceImpl implements CustomerWxinInfoService {
    private Logger log = LoggerFactory.getLogger(CustomerWxinInfoServiceImpl.class);

    @Autowired
    private CustomerWxinfoRelService customerWxinfoRelService;



    @Override
    public String getOpenidByCustomerId(String customerId) {
        CustomerWxinfoRelDO customerWxinfoRelDO = customerWxinfoRelService.get(customerId);
        if (customerWxinfoRelDO != null) {
            return customerWxinfoRelDO.getOpenId();
        }
        return null;
    }
}
